<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PermissionEditor.aspx.cs" Inherits="umbraco.cms.presentation.user.PermissionEditor" %>

<%@ Register Src="NodePermissions.ascx" TagName="NodePermissions" TagPrefix="user" %>
<%@ Register Src="~/umbraco/Trees/ContentTreeControl.ascx" TagName="TreeControl" TagPrefix="tree" %>
<%@ Register TagPrefix="ui" Namespace="umbraco.uicontrols" Assembly="controls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Content Tree Permissions</title>
	<link href="../css/umbracoGui.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript" src="../js/prototype.js"></script>	
	<script type="text/javascript" src="../js/editorBarFunctions.js"></script>		
	<script type="text/javascript" language="javascript">

    function objTree_NodeClicked(id) 
    {   
        var currentUserID = $get('<%=hidUserID.ClientID %>');
        BeginShowNodePermissions(id, currentUserID.value);        
    }    
    
    </script>
    
</head>
<body onload="resizePanel('pnlUmbraco',true);" onresize="resizePanel('pnlUmbraco',true);">
	<form id="frmPermissions" runat="server">
	
	<asp:ScriptManager runat="server" EnablePartialRendering="true" ID="objScripts">	   
	    <Scripts>
	        <asp:ScriptReference Path="~/umbraco/users/PermissionsEditor.js" />
	    </Scripts>
	    <Services>
	        <asp:ServiceReference Path="~/umbraco/users/PermissionsHandler.asmx" />
	    </Services>
	</asp:ScriptManager>
	
	<ui:UmbracoPanel id="pnlUmbraco" runat="server" hasMenu="true" Text="Content Tree Permissions" Width="608px" >
		<ui:Pane id="pnl1" style="padding:10px;text-align:left;" runat="server">
					
			
			<div style="padding: 10px;">						
				<div style="display: block; clear: both; width: 655px; height: 500px;">
					<div style="float: left; height: 490px; margin-right:20px; overflow: auto;">
						<h3 style="margin:0;">User:&nbsp;<strong><%=UmbracoUser.Name%></strong></h3>
						
						<div class="propertypane" style="overflow:auto;width:290px;top:0px;height:323px;" >
						    <tree:TreeControl runat="server" ID="objTree" OnClientNodeChecked="objTree_NodeChecked" OnClientNodeClicked="objTree_NodeClicked" />
						</div>
						<div>Selected Nodes:</div>
						<div id="checkedNodes"></div>
						
					</div>
					<div style="width: 250px; float: left;">

						<asp:HiddenField runat="server" ID="hidUserID" Value="-1" />
					    
						<div id="currPermissions">
						    <user:NodePermissions id="nodePermissions" runat="server" OnClientItemChecked="nodePermissions_ItemChecked" />
						</div>
	                    
					</div>
				</div>
			</div>
					
				
		</ui:Pane>
	</ui:UmbracoPanel>
	</form>
	
</body>
</html>
